package com.wc.alorithm_blue_bridge._动态规划.Q3367;

import java.io.*;

/**
 * @Author congege
 * @Description 破损的楼梯
 * https://www.lanqiao.cn/problems/3367/learning/?page=1&first_category_id=1
 * @Date Created in 2023/11/29-20:40
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();

        int n = sc.nextInt();
        int m = sc.nextInt();
        int mod = (int) 1e9 + 7;
        int[] array = new int[n + 1];
        for (int i = 1; i <= m; i++) {
            int idx = sc.nextInt();
            // 为了判别是不是坏的
            array[idx] = -1;
        }
        array[0] = 1;
        if (array[1] == -1) {
            array[1] = 0;
        } else {
            array[1] = 1;
        }

        for (int i = 2; i <= n; i++) {
            if (array[i] != -1) {
                // 好的就一样是只有两个地方上来
                array[i] = (array[i - 1] + array[i - 2]) % mod;
            } else {
                // 坏的就没有人能上来，所以是0
                array[i] = 0;
            }
        }
        System.out.println(array[n]);
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (Exception e) {
                return -1;
            }
            return (int) in.nval;
        }
    }
}
